package com.lby.psychology.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@Tag(name = "异常页面路由")
@RestController
public class ErrorViewController {

    @Operation(summary = "404 跳转页面")
    @RequestMapping("/404")
    public ModelAndView noPage() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/error-404.html");
        return modelAndView;
    }


    @Operation(summary = "500 跳转页面")
    @RequestMapping("/500")
    public ModelAndView serverErrorPage() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/error-500.html");
        return modelAndView;
    }


    @Operation(summary = "login 跳转页面")
    @RequestMapping("/login")
    public ModelAndView loginPage() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/login.html");
        return modelAndView;
    }

    @Operation(summary = "index 跳转页面")
    @RequestMapping("/")
    public ModelAndView indexPage() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/profile.html");
        return modelAndView;
    }

}
